<extend name="Layout/ins_popup" />
<block name="content">
	<div class="popup-frame">
		<div class="popup-header">
			<div class="pull-left">
				<h1>添加</h1>
			</div>
			<div class="pull-right">
				<a id="save" class="btn" >确定</a>
				<a id="close" class="btn btn-return">关闭</a>
			</div>
		</div>
		<div class="popup-body">
			<div class="popup-body-scroll">
				<div class="popup-content">
					<form id="form_data" name="form_data" method="post">
						<input type="hidden" name="ajax" id="ajax" value="1">
						<input type="hidden" name="id" id="id" >
						<input type="hidden" name="opmode" id="opmode" value="add">
						<input type="hidden" name="controller" value="{$controller}">
						
							<label class="input-label" for="name">名称*：</label>
							
								<input class="input" type="text" id="name" name="name" check="required" info="请输入名称">
							</div>
						</div>
						
							<label class="input-label" for="sort">排序：</label>
							
								<input class="input" type="text" id="sort" name="sort" >
							</div>
						</div>
						
							<label class="input-label" for="sort">状态：</label>
							
								<select class="input"  name="is_del" id="is_del">
									<option value="0">启用</option>
									<option value="1">禁用</option>
								</select>
							</div>
						</div>
					</form>
				</div>
			</div>
		</div>

	</div>
</block>
<block name="js">
	<script type="text/javascript">
		var index = parent.layer.getFrameIndex(window.name);
		layui.use(['global'], function() {
			var $ = layui.jquery;
			//关闭iframe
			$('#close').click(function() {
				parent.layer.close(index);
			});
			//保存后关闭
			$('#save').on('click', function() {
				send_form("form_data", "{:url('UserFolder/save')}", "", function(data) {
					if (data.status) {
						layer.msg(data.info, function() {
							parent.location.reload(true);
							parent.layer.close(index);
						});
					} else {
						layer.msg(data.info);
					}
				});
			});
		});
	</script>
</block>